﻿$.fn.ajaxSubmit = function (func) {
    /* Change a form's submission type to ajax */
    this.submit(
        function () {
            var form = this;
            var params = {};
            $(this).find(":input").each(function () {
                params[this.name || this.id || this.parentNode.name || this.parentNode.id] = this.value;
            });

            $.post(this.getAttribute("action"), params,
                function (xml) {
                    alert($(xml).html());
                    //
                    //  ok, put the post
                    $(xml).html();
                    $(form).parents("div.content").html($(xml).html());

                    $(xml).find("script").each(function () { alert(this.text()) });
                });
            return false;
        });
}



    function applyStyles() {
        $("button").button();
    }